﻿Public Class SetGamePlayOption

    Property Val1 As Decimal
    Property Val2 As Decimal

    Public Sub Load(stream As IO.StreamReader)

        Dim shouldExit As Boolean = False
        Dim data As LineData

        Do Until shouldExit OrElse stream.EndOfStream
            data = ReadLineData(stream)

            Select Case data.LineType

                Case DataLineType.EndBlockChar
                    shouldExit = True
                Case DataLineType.StarBlockChar
                    ' skip
                Case DataLineType.KeyValue

                    Select Case data.KeyValueData.Key
                        Case Else
                            AddSkipedLine(data.OriginalText)
                    End Select

                Case DataLineType.InLine
                    Val1 = Decimal.Parse(data.InLineData.Values(0), Globalization.CultureInfo.InvariantCulture)
                    Val2 = Decimal.Parse(data.InLineData.Values(1), Globalization.CultureInfo.InvariantCulture)
                    shouldExit = data.InLineData.WithEndOfBlock
                Case Else
                    AddSkipedLine(data.OriginalText)
            End Select
        Loop
    End Sub

End Class
